package vn.gq.udv.utils;

import vn.gq.udv.template.GQConst;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.widget.Toast;

public class ButtonHelper {
	
	private Context context;
	
	public ButtonHelper(Context context) {
		this.context = context;
	}
	
	public void showMoreApp() {
		try {
			context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(GQConst.SEARCHURI)));
		} catch (ActivityNotFoundException e) {
			try {
				context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/search?q=pub:UNGDUNGVIET&c=apps&sort=1")));
			} catch(Exception ex) {
				Toast.makeText(context, "Không có ứng dụng Google Play trong máy", Toast.LENGTH_SHORT).show();
			}
		}
	}
}
